<template>
  <div>
    <div id="main" style="width: 100%; height: 400px"></div>
  </div>
</template>

<script>
import echarts from "echarts";
export default {
  data() {
    return {};
  },
  methods: {
    darwLine() {
      var echarts = require("echarts");
      var myChart = echarts.init(document.getElementById("main"));
      myChart.setOption({
        xAxis: {
          type: "category",
          data: ["赵", "钱", "孙", "李", "周", "吴", "郑","王"],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            data: [46, 78, 45, 50, 60, 76, 80,82],
            type: "line",
          },
          {
            data: [62, 60, 52, 70, 66, 75, 95,86],
            type: "line",
          },{
            data: [58, 55, 70, 72, 64, 70, 88,91],
            type: "line",
          },
        ],
      }),
        (window.onresize = function () {
          myChart.resize();
        });
    },
  },
  mounted() {
    this.darwLine();
  },
};
</script>

<style scoped>
</style>